#ifdef USE_YAML
string get_scalar(const ynode & node)
{
	string s;
	switch(node.Type())
	{
	case YAML::NodeType::Scalar:
		node >> s;
		return s;
	case YAML::NodeType::Null:
		return string("void");
	default: 
		assert(0 && "error, neither null or scalar !");
	}
}
#endif
void set_mask8(char & mask, char value, bool set)
{
	if(set)
		mask |= value;
	else
		mask &= ~ (0 | value); // unsets
}
void set_mask16(short & mask, short value, bool set)
{
	if(set)
		mask |= value;
	else
		mask &= ~ (0 | value); // unsets
}
string tabulate(string s, size_t z)
{
    string a;
    for(size_t i = 0; i < z - s.size(); ++ i)
        a.append(" ");
    return s+a;
}
string inspect_mask(char c)
{
	string s;
	if(c & CONIC) s += "cone ";
	if(c & BELL) s += "bell ";
	if(c & CHAIN) s += "chain ";
	if(c & MISSILE) s += "missile ";
	return s;	
}
SceneTypeMask	Application :: GetScMgrType()
{
	string str = configfile -> getSetting("SceneManager");
	if(str == "BSP_INTERIOR") return ST_INTERIOR;
	if(str == "OCTREE_GENERIC") return ST_GENERIC;
	if(str == "PAGING") return ST_EXTERIOR_REAL_FAR;
	return ST_GENERIC;
}
